/**
* @file distance.c
 *
 * @section desc File description
 *
 * @section copyright Copyright
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; version 2
 * of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 * @section infos File informations
 *
 * $Date$ 2013 05 02
 * $Rev$ 1 
 * $Author$ Benjamin Sientzoff
 * $URL$
 */

#include "tpl_os_internal_types.h"

//Tokens codes
 // getters
#define GETPOS 1
#define GETTIME 2
#define GETLOG 3
 // answers
#define POS 128
#define TIME 129
#define LOG 130
 // actions
#define GOTO 192
#define MOVL 193
#define MOVR 194
#define SHOOT 195

//Error codes
// NO ERROR
#define ERROR_OK 0
// every button is pushed
#define ERROR_RACKET 1
//Bad motor power
#define ERROR_MOTOR 2
// motor and buttons errors
#define ERROR_MR 3

//Logs structure
struct log {
		//power of the wheel's motor
		S8 mw_p;
		//racket positions
				//value	button1	button2
				//	1			released		released
				//	2			pushed			released
				//	3			released		pushed
				//	4			pushed			pushed
		U8 raq;
		// system time when log is created
		U32 time;
		// U32 time;
		// error code
		U8 error;
};

//typedef struct log log;

/**
 * Actions vector
 * action		offset/delay		speed/power
 */
struct action {
		// code of action
		U8 value;
		// first param for actions
		// (absolute position, offset or delay)
		U8 param1;
		// second param for actions
		// (power or speed)
		U8 param2;
};

//functions signatures
void create_log(struct log *var_log, int wheel_motor_power, int button1, int button2);

